#{set title:'All Notifications' /}

#{if isLoggedIn}
#{extends 'logged_user.html' /}
<div class="post" style="padding:top:0px">

  <h3 style="padding-top:0px;">Your Notifications</h3>
  
  <table>
  	<th>Type</th>
    <th>Title</th>
    <th>Offerer</th>
    <th>Requester</th>
	<th>Action</th>
	<th></th>
    <th></th>
  #{if newHandshakes}
  

    #{list items:newHandshakes, as:'notification1'}
    <tr>
		<td>
		 #{if notification1.status == notification1.status.SHOW}
		 <img src="@{'/public/images/hotnotification.jpg'}" />
		 #{/if}
		Handshake
		</td>
      #{if notification1.handshake.checkOriginallyAnOffer}
      <td>${notification1.handshake.offer.title}</td>
      #{/if}
      #{else}
      <td>${notification1.handshake.request.title}</td>
      #{/else}
      <td>${notification1.handshake.offer.user.fullname}</td>
      <td>${notification1.handshake.request.user.fullname}</td>	  
	  <td>
	  #{if notification1.handshake.status == notification1.handshake.status.IGNORED}
	  Your Request is not accepted. Offerer Says:'${notification1.reason}'
	  #{/if}
	  #{elseif notification1.handshake.status == notification1.handshake.status.ACCEPTED}
	  Accepted
	  #{/elseif}
	  #{elseif notification1.handshake.status == notification1.handshake.status.NOTVOTED}
	  Accepted so you need to rate it ;)
	  #{/elseif}
	  #{elseif notification1.handshake.status == notification1.handshake.status.REJECTED}
	  Your Request is not accepted because another person was chosen
	  #{/elseif}
	  #{elseif notification1.handshake.status == notification1.handshake.status.CANCELLED}
	  Other Party Cancelled
	  #{/elseif}
	  #{elseif notification1.handshake.status == notification1.handshake.status.DONE}
	  DONE :))
	  #{/elseif}	  
	  </td>
	  
	  
	  <td>
	  #{if notification1.handshake.status == notification1.handshake.status.IGNORED}
	  <img src="@{'/public/images/ignored.jpg'}" />
	  #{/if}
	  #{elseif notification1.handshake.status == notification1.handshake.status.ACCEPTED}
	  <img src="@{'/public/images/accepted.jpg'}" />
	  #{/elseif}
	  #{elseif notification1.handshake.status == notification1.handshake.status.NOTVOTED}
	  <img src="@{'/public/images/accepted.jpg'}" />
	  #{/elseif}
	  #{elseif notification1.handshake.status == notification1.handshake.status.REJECTED}
	  <img src="@{'/public/images/rejected.jpg'}" />
	  #{/elseif}
	  #{elseif notification1.handshake.status == notification1.handshake.status.CANCELLED}
	  <img src="@{'/public/images/cancelled.jpg'}" />
	  #{/elseif}
	  #{elseif notification1.handshake.status == notification1.handshake.status.DONE}
	  <img src="@{'/public/images/done.jpg'}" />
	  #{/elseif}	  
	  </td>
      <td><a href="@{Handshakes.show(notification1.handshake.id)}">Details</a></td>
	  
    </tr>
    #{/list}

  #{/if}
  #{else}
  
  #{/else}

  #{if newOffers}
    #{list items:newOffers, as:'notification2'}
    <tr>
	<td>
	#{if notification2.status == notification2.status.SHOW}
	<img src="@{'/public/images/hotnotification.jpg'}" />
	#{/if}
	Request to Offer
	</td>
	<td>${notification2.offer.title}</td>
	<td>${notification2.handshake.offer.user.fullname}</td>
	<td>${notification2.handshake.request.user.fullname}</td>
	<td>Answer Required</td>
	<td><img src="@{'/public/images/newRequest.jpg'}" /></td>
    <td><a href="@{Offers.showDetails(notification2.offer.id)}">Details</a></td>
    </tr>
    #{/list}


  
  #{/if}
  #{else}
    
  #{/else}
  #{if newRequests}
    #{list items:newRequests, as:'notification4'}
    <tr>
	<td>
	#{if notification4.status == notification4.status.SHOW}
	<img src="@{'/public/images/hotnotification.jpg'}" />
	#{/if}	
	Offer to Request
	</td>
	<td>${notification4.handshake.offer.title}</td>
	<td>${notification4.handshake.offer.user.fullname}</td>
	<td>${notification4.handshake.request.user.fullname}</td>
	<td>Answer Required</td>
	<td><img src="@{'/public/images/newRequest.jpg'}" /></td>
    <td><a href="@{Requests.showDetails(notification4.request.id)}">Details</a></td>
    </tr>
    #{/list}


  
  #{/if}
  #{else}
    
  #{/else}
  #{if newComments}
  	<th>Type</th>
    <th>Title</th>
    <th>Offerer</th>
    <th>Requester</th>
	<th>Action</th>
	<th>Commenter</th>
    <th></th>
    #{list items:newComments, as:'notification3'}
    <tr>
	  <td>
	  #{if notification3.status == notification3.status.SHOW}
	  <img src="@{'/public/images/hotnotification.jpg'}" />
	  #{/if}	  
	  Comment
	  </td>
      #{if notification3.comment.handshake.checkOriginallyAnOffer}
      <td>${notification3.comment.handshake.offer.title}</td>
      #{/if}
      #{else}
      <td>${notification3.comment.handshake.request.title}</td>
      #{/else}
      <td>${notification3.comment.handshake.offer.user.fullname}</td>
      <td>${notification3.comment.handshake.request.user.fullname}</td>
	  <td>New Comment</td>
	  <td>
	  #{if notification3.user.id == notification3.comment.handshake.offer.user.id }
	  ${notification3.comment.handshake.request.user.fullname}
	  #{/if}
	  #{elseif notification3.user.id == notification3.comment.handshake.request.user.id}
	  ${notification3.comment.handshake.offer.user.fullname}
	  #{/elseif}
	  </td>
	  <td>
	  <a href="@{Handshakes.shownotification(notification3.id)}">Comment Details</a>
	  <a href="@{Handshakes.show(notification3.comment.handshake.id)}">Handshake Details</a>
	  </td>
    </tr>
    #{/list}

  
  
  #{/if}

  
 </table>
 #{if ( !newOffers && !newHandshakes && !newComments && !newRequests)}
  <p>
    You have no notifications so lets check-out recent news ;)
  </p> 
  #{/if}
</div>

#{/if}
#{else}
#{extends 'unlogged_user.html' /}
<font color="red"><b>To see this page, you should log-in first !</b></font>
<style>
.linearBg2 {
  /* fallback */
  background-color: #eee;
  background: url(images/linear_bg_2.png);
  background-repeat: repeat-x;
  
  /* Safari 4-5, Chrome 1-9 */
  background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#1a82f7), to(#2F2727));
  
  /* Safari 5.1, Chrome 10+ */
  background: -webkit-linear-gradient(top, #eee, #fff);
  
  /* Firefox 3.6+ */
  background: -moz-linear-gradient(top, #eee, #fff);
  
  /* IE 10 */
  background: -ms-linear-gradient(top, #eee, #fff);
  
  /* Opera 11.10+ */
  background: -o-linear-gradient(top, #eee, #fff);
}
.linearBg2 a {
color:#2c76a5;
}
</style>


<div class="post" style="padding-top:5px; padding:top:00px">
  
  <div class="user_tabs" style="margin-top:10px;">
    <ul>
      <li>            
       <a id="user_tab_a_1" href="#" class="active" no="1" onmousedown="abortTimer();">Making it happen!</a>    
      </li>
      <li>
        <a id="user_tab_a_2" href="#" no="2" onmousedown="abortTimer();">A Hard Day's Cooking Night</a>
      </li>
      <li>
        <a id="user_tab_a_3" href="#" no="3" onmousedown="abortTimer();">Mowers of Lawn</a>
      </li>
      <li>
        <a id="user_tab_a_4" href="#" no="4" onmousedown="abortTimer();">Ain't No Spot When He Cleans</a>
      </li>
    </ul>
  </div>
  <div class="index_tab_content" id="index_tab_content_1">    
    <div onmousedown="abortTimer();" style="text-align:center; vertical-align:middle; padding-top:20px;padding-bottom:10px;">
      <iframe width="560" height="315" src="http://www.youtube.com/embed/UqUTDXk-dAA?rel=0" frameborder="0" allowfullscreen></iframe>
	</div>    
    <div style="clear:both;"></div>
  </div>
  <div class="index_tab_content nonvisible" id="index_tab_content_2">
    <div class="images">
      <div align="center"><img src="@{'/public/images/cooking1.jpg'}" /></div>
      <div align="center"><img src="@{'/public/images/cooking2.jpg'}" /></div>
    </div>   
    <div class="service">
      <b>Service:</b><br  />
      <p>Cooking, mostly chinese, some thai</p>
      <b>Tagline:</b><br  />
      <p>Two people, one eager to cook, one eager to learn, none eager to clean</p>
      <b>Quotes:</b><br  />
      <p>- My eye, my beautiful eye!<br  />
        - I have no idea what I am eating, but it tastes good enough.<br />
        - Which was the bowl with vomit in it, again?</p>
    </div>  
    <div style="clear:both;"></div>
  </div>
  
  <div class="index_tab_content nonvisible" id="index_tab_content_3">
    <div class="images">
      <div align="center"><img src="@{'/public/images/lawn1.jpg'}" /></div>
      <div align="center"><img src="@{'/public/images/lawn2.jpg'}" /></div>
    </div>
    
    <div class="service">
      <b>Service:</b><br  />
      <p>Gardening services, most importantly lawn mowing</p>
      <b>Tagline:</b><br  />
      <p>It was supposed to be an ordinary day in the garden</p>
      <b>Quotes:</b><br  />
      <p>- I drink your lemonade!<br  />
        - I didn't know a lawn mower could do that.<br />
        - Is everyone's fingers intact?</p>
    </div>   
    <div style="clear:both;"></div>
  </div>
  
  <div class="index_tab_content nonvisible" id="index_tab_content_4">
    <div class="images">
      <div align="center"><img src="@{'/public/images/garage1.jpg'}" /></div>
      <div align="center"><img src="@{'/public/images/garage2.jpg'}" /></div>
    </div>
    
    <div class="service">
      <b>Service:</b><br  />
      <p>Cleaning a garage</p>
      <b>Tagline:</b><br  />
      <p>In the garage, no one can hear you clean</p>
      <b>Quotes:</b><br  />
      <p>- Do you know what this is? - No, but I'll clean the hell out of it.<br  />
	- Is it safe to mix these stuff? - Probably not. (continues mixing cleaning materials)<br />
        - Did I miss a spot? - (Everyone) Nooooo!</p>
    </div>

    <div style="clear:both;"></div>
    </div>
  </div>
<div class="post">
  <h4>Humble Bee of The Month</h4>
  <div class="interview">
    <div class="image">
      <div align="center"><img src="@{'/public/images/hbirdman.jpg'}" /></div>
      <div align="center">Harvey Birdman<br  /><a href="#nowhere">Working Bee</a></div>
    </div>
    
    <div class="baloon">
      <blockquote>
        <span class="bqstart">&ldquo;</span>
        I joined because back then I had too much spare time. Now I try to manage my schedule to create free time for services! 
        <span class="bqend">&rdquo;</span>
      </blockquote>
    </div>
    
    <div class="story">
      <b>Let It Bee:</b>Can you tell us about yourself?<br  />
      <b>Harvey Birdman:</b>Well, I am an ex-superhero, currently an attorney. My power comes from the rays of the sun. I also have the power of attorney [laughs]. <br  />
      <b>Let It Bee:</b>When did you participate in your first service?<br  />
      <b>Harvey Birdman:</b>It was eight months ago. When I first joined I had trouble with participating in services. Then ... <a href="#nowhere">read the rest of the interview</a> <br  />
    </div>
    
  </div>
  
</div>
#{/else}


<script>
var clickIndex = 1;

var tid = setTimeout(mycode, 3000); 
function mycode() { 
	 clickIndex ++;
	 if (clickIndex == 5) clickIndex = 1;
	 
	 $('#user_tab_a_' + clickIndex.toString()).click();
	 tid = setTimeout(mycode, 3000); 
} 

function abortTimer() 
{ 		 
	clearTimeout(tid); 
} 
</script>
<!-- KUTAYOZDOGRU END -->



